home *** CD-ROM | disk | FTP | other *** search
/ Mastering Web Site Development / Microsoft Mastering Web Site Development (Microsoft) (1997).iso / Labs / Lab06 / home.asp next >
Text File  |  1997-04-24  |  17KB  |  520 lines

  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
  2. <html>
  3.  
  4. <head>
  5. <meta http-equiv="Content-Type"
  6. content="text/html; charset=iso-8859-1">
  7. <meta name="GENERATOR"
  8. content="Microsoft FrontPage (Visual InterDev Edition) 2.0">
  9. <title>State University</title>
  10. </head>
  11.  
  12. <BODY BGCOLOR="#FFFFFF">
  13.  
  14. <center><img src="images/sutitle.gif">
  15. <HR>
  16. To see the courses we offer, click on one of our popular majors.
  17. <p>
  18.  
  19. <script language="VBScript">
  20. Sub imgMath_Click()
  21. popClasses.Clear
  22. <%i = 0%>
  23.  
  24. <!--METADATA TYPE="DesignerControl" startspan
  25.     <OBJECT ID="rsClasses" WIDTH=151 HEIGHT=24
  26.      CLASSID="CLSID:F602E721-A281-11CF-A5B7-0080C73AAC7E">
  27.         <PARAM NAME="_Version" VALUE="65536">
  28.         <PARAM NAME="_Version" VALUE="65536">
  29.         <PARAM NAME="_ExtentX" VALUE="3986">
  30.         <PARAM NAME="_ExtentY" VALUE="635">
  31.         <PARAM NAME="_StockProps" VALUE="0">
  32.         <PARAM NAME="DataConnection" VALUE="StateU">
  33.         <PARAM NAME="CommandText" VALUE="Select Title From Classes Where MajorID=1">
  34.     </OBJECT>
  35. -->
  36. <%
  37. fHideNavBar = False
  38. fHideNumber = False
  39. fHideRequery = False
  40. fHideRule = False
  41. stQueryString = ""
  42. fEmptyRecordset = False
  43. fFirstPass = True
  44. fNeedRecordset = False
  45. fNoRecordset = False
  46. tBarAlignment = "Left"
  47. tHeaderName = "rsClasses"
  48. tPageSize = 0
  49. tPagingMove = ""
  50. tRangeType = "Text"
  51. tRecordsProcessed = 0
  52. tPrevAbsolutePage = 0
  53. intCurPos = 0
  54. intNewPos = 0
  55. fSupportsBookmarks = True
  56. fMoveAbsolute = False
  57.  
  58. If IsEmpty(Session("rsClasses_Recordset")) Then
  59.     fNeedRecordset = True
  60. Else
  61.     If Session("rsClasses_Recordset") Is Nothing Then
  62.         fNeedRecordset = True
  63.     Else
  64.         Set rsClasses = Session("rsClasses_Recordset")
  65.     End If
  66. End If
  67.  
  68. If fNeedRecordset Then
  69.     Set StateU = Server.CreateObject("ADODB.Connection")
  70.     StateU.ConnectionTimeout = Session("StateU_ConnectionTimeout")
  71.     StateU.CommandTimeout = Session("StateU_CommandTimeout")
  72.     StateU.Open Session("StateU_ConnectionString"), Session("StateU_RuntimeUserName"), Session("StateU_RuntimePassword")
  73.     Set cmdTemp = Server.CreateObject("ADODB.Command")
  74.     Set rsClasses = Server.CreateObject("ADODB.Recordset")
  75.     cmdTemp.CommandText = "Select Title From Classes Where MajorID=1"
  76.     cmdTemp.CommandType = 1
  77.     Set cmdTemp.ActiveConnection = StateU
  78.     rsClasses.Open cmdTemp, , 0, 1
  79. End If
  80. On Error Resume Next
  81. If rsClasses.BOF And rsClasses.EOF Then fEmptyRecordset = True
  82. On Error Goto 0
  83. If Err Then fEmptyRecordset = True
  84.  
  85. If Not IsEmpty(Session("rsClasses_Filter")) And Not fEmptyRecordset Then
  86.     rsClasses.Filter = Session("rsClasses_Filter")
  87.     If rsClasses.BOF And rsClasses.EOF Then fEmptyRecordset = True
  88. End If
  89.  
  90. If fEmptyRecordset Then
  91.     fHideNavBar = True
  92.     fHideRule = True
  93. End If
  94.  
  95. Do
  96.     If fEmptyRecordset Then Exit Do
  97.     If Not fFirstPass Then
  98.         rsClasses.MoveNext
  99.     Else
  100.         fFirstPass = False
  101.     End If
  102.     If rsClasses.EOF Then Exit Do
  103. %>
  104. <!--METADATA TYPE="DesignerControl" endspan-->
  105. popClasses.AddItem "<%= rsClasses("title") %>",<%=i%>
  106. <%i = i+1%>  
  107.  
  108.  
  109. <!--METADATA TYPE="DesignerControl" startspan
  110.     <OBJECT ID="DataRangeFtr1" WIDTH=151 HEIGHT=24
  111.      CLASSID="CLSID:F602E722-A281-11CF-A5B7-0080C73AAC7E">
  112.         <PARAM NAME="_Version" VALUE="65536">
  113.         <PARAM NAME="_ExtentX" VALUE="3986">
  114.         <PARAM NAME="_ExtentY" VALUE="635">
  115.         <PARAM NAME="_StockProps" VALUE="0">
  116.     </OBJECT>
  117. -->
  118. <%
  119. Loop
  120. If tRangeType = "Table" Then Response.Write "</TABLE>"
  121. If tPageSize > 0 Then
  122.     If Not fHideRule Then Response.Write "<HR>"
  123.     If Not fHideNavBar Then
  124.         %>
  125.         <TABLE WIDTH=100% >
  126.         <TR>
  127.             <TD WIDTH=100% >
  128.                 <P ALIGN=<%= tBarAlignment %> >
  129.                 <FORM <%= "ACTION=""" & Request.ServerVariables("PATH_INFO") & stQueryString & """" %> METHOD="POST">
  130.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   <<   ">
  131.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   <    ">
  132.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="    >   ">
  133.                     <% If fSupportsBookmarks Then %>
  134.                         <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   >>   ">
  135.                     <% End If %>
  136.                     <% If Not fHideRequery Then %>
  137.                         <INPUT TYPE="Submit" NAME="<% =tHeaderName & "_PagingMove" %>" VALUE=" Requery ">
  138.                     <% End If %>
  139.                 </FORM>
  140.                 </P>
  141.             </TD>
  142.             <TD VALIGN=MIDDLE ALIGN=RIGHT>
  143.                 <FONT SIZE=2>
  144.                 <%
  145.                 If Not fHideNumber Then
  146.                     If tPageSize > 1 Then
  147.                         Response.Write "<NOBR>Page: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
  148.                     Else
  149.                         Response.Write "<NOBR>Record: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
  150.                     End If
  151.                 End If
  152.                 %>
  153.                 </FONT>
  154.             </TD>
  155.         </TR>
  156.         </TABLE>
  157.     <%
  158.     End If
  159. End If
  160. %>
  161. <!--METADATA TYPE="DesignerControl" endspan-->
  162.  
  163. popClasses.PopUp
  164. end sub
  165.  
  166. </script>
  167.  
  168. <object id="imgMath"
  169.     name="imgMath"
  170.     classid="CLSID:D4A97620-8E8F-11CF-93CD-00AA00C08FDF"
  171.     align="baseline" border="0" width="96" height="96">
  172.     <param name="PicturePath" value="images/Math.gif">
  173.     <param name="AutoSize" value="-1">
  174.     <param name="BorderStyle" value="0">
  175.     <param name="SizeMode" value="3">
  176.     <param name="Size" value="2540;2540">
  177.     <param name="PictureAlignment" value="0">
  178.     <param name="VariousPropertyBits" value="19">
  179. </object>
  180.  
  181. <script language="VBScript">
  182.  
  183. Sub imgHistory_Click()
  184. popClasses.Clear
  185. <%i = 0%>
  186.  
  187. <!--METADATA TYPE="DesignerControl" startspan
  188.     <OBJECT ID="rsClasses" WIDTH=151 HEIGHT=24
  189.      CLASSID="CLSID:F602E721-A281-11CF-A5B7-0080C73AAC7E">
  190.         <PARAM NAME="_Version" VALUE="65536">
  191.         <PARAM NAME="_Version" VALUE="65536">
  192.         <PARAM NAME="_ExtentX" VALUE="3986">
  193.         <PARAM NAME="_ExtentY" VALUE="635">
  194.         <PARAM NAME="_StockProps" VALUE="0">
  195.         <PARAM NAME="DataConnection" VALUE="StateU">
  196.         <PARAM NAME="CommandText" VALUE="Select Title from Classes where MajorID = 2">
  197.     </OBJECT>
  198. -->
  199. <%
  200. fHideNavBar = False
  201. fHideNumber = False
  202. fHideRequery = False
  203. fHideRule = False
  204. stQueryString = ""
  205. fEmptyRecordset = False
  206. fFirstPass = True
  207. fNeedRecordset = False
  208. fNoRecordset = False
  209. tBarAlignment = "Left"
  210. tHeaderName = "rsClasses"
  211. tPageSize = 0
  212. tPagingMove = ""
  213. tRangeType = "Text"
  214. tRecordsProcessed = 0
  215. tPrevAbsolutePage = 0
  216. intCurPos = 0
  217. intNewPos = 0
  218. fSupportsBookmarks = True
  219. fMoveAbsolute = False
  220.  
  221. If IsEmpty(Session("rsClasses_Recordset")) Then
  222.     fNeedRecordset = True
  223. Else
  224.     If Session("rsClasses_Recordset") Is Nothing Then
  225.         fNeedRecordset = True
  226.     Else
  227.         Set rsClasses = Session("rsClasses_Recordset")
  228.     End If
  229. End If
  230.  
  231. If fNeedRecordset Then
  232.     Set StateU = Server.CreateObject("ADODB.Connection")
  233.     StateU.ConnectionTimeout = Session("StateU_ConnectionTimeout")
  234.     StateU.CommandTimeout = Session("StateU_CommandTimeout")
  235.     StateU.Open Session("StateU_ConnectionString"), Session("StateU_RuntimeUserName"), Session("StateU_RuntimePassword")
  236.     Set cmdTemp = Server.CreateObject("ADODB.Command")
  237.     Set rsClasses = Server.CreateObject("ADODB.Recordset")
  238.     cmdTemp.CommandText = "Select Title from Classes where MajorID = 2"
  239.     cmdTemp.CommandType = 1
  240.     Set cmdTemp.ActiveConnection = StateU
  241.     rsClasses.Open cmdTemp, , 0, 1
  242. End If
  243. On Error Resume Next
  244. If rsClasses.BOF And rsClasses.EOF Then fEmptyRecordset = True
  245. On Error Goto 0
  246. If Err Then fEmptyRecordset = True
  247.  
  248. If Not IsEmpty(Session("rsClasses_Filter")) And Not fEmptyRecordset Then
  249.     rsClasses.Filter = Session("rsClasses_Filter")
  250.     If rsClasses.BOF And rsClasses.EOF Then fEmptyRecordset = True
  251. End If
  252.  
  253. If fEmptyRecordset Then
  254.     fHideNavBar = True
  255.     fHideRule = True
  256. End If
  257.  
  258. Do
  259.     If fEmptyRecordset Then Exit Do
  260.     If Not fFirstPass Then
  261.         rsClasses.MoveNext
  262.     Else
  263.         fFirstPass = False
  264.     End If
  265.     If rsClasses.EOF Then Exit Do
  266. %>
  267. <!--METADATA TYPE="DesignerControl" endspan-->
  268. popClasses.AddItem "<%= rsClasses("title") %>",<%=i%>
  269. <%i = i+1%>  
  270.  
  271. <!--METADATA TYPE="DesignerControl" startspan
  272.     <OBJECT ID="DataRangeFtr2" WIDTH=151 HEIGHT=24
  273.      CLASSID="CLSID:F602E722-A281-11CF-A5B7-0080C73AAC7E">
  274.         <PARAM NAME="_Version" VALUE="65536">
  275.         <PARAM NAME="_ExtentX" VALUE="3986">
  276.         <PARAM NAME="_ExtentY" VALUE="635">
  277.         <PARAM NAME="_StockProps" VALUE="0">
  278.     </OBJECT>
  279. -->
  280. <%
  281. Loop
  282. If tRangeType = "Table" Then Response.Write "</TABLE>"
  283. If tPageSize > 0 Then
  284.     If Not fHideRule Then Response.Write "<HR>"
  285.     If Not fHideNavBar Then
  286.         %>
  287.         <TABLE WIDTH=100% >
  288.         <TR>
  289.             <TD WIDTH=100% >
  290.                 <P ALIGN=<%= tBarAlignment %> >
  291.                 <FORM <%= "ACTION=""" & Request.ServerVariables("PATH_INFO") & stQueryString & """" %> METHOD="POST">
  292.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   <<   ">
  293.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   <    ">
  294.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="    >   ">
  295.                     <% If fSupportsBookmarks Then %>
  296.                         <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   >>   ">
  297.                     <% End If %>
  298.                     <% If Not fHideRequery Then %>
  299.                         <INPUT TYPE="Submit" NAME="<% =tHeaderName & "_PagingMove" %>" VALUE=" Requery ">
  300.                     <% End If %>
  301.                 </FORM>
  302.                 </P>
  303.             </TD>
  304.             <TD VALIGN=MIDDLE ALIGN=RIGHT>
  305.                 <FONT SIZE=2>
  306.                 <%
  307.                 If Not fHideNumber Then
  308.                     If tPageSize > 1 Then
  309.                         Response.Write "<NOBR>Page: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
  310.                     Else
  311.                         Response.Write "<NOBR>Record: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
  312.                     End If
  313.                 End If
  314.                 %>
  315.                 </FONT>
  316.             </TD>
  317.         </TR>
  318.         </TABLE>
  319.     <%
  320.     End If
  321. End If
  322. %>
  323. <!--METADATA TYPE="DesignerControl" endspan-->
  324.  
  325.  
  326. popClasses.PopUp
  327. end sub
  328.  
  329. </script>
  330.     
  331. <object id="imgHistory"
  332.     name="imgHistory"
  333.     classid="CLSID:D4A97620-8E8F-11CF-93CD-00AA00C08FDF"
  334.     align="baseline" border="0" width="96" height="96">
  335.     <param name="PicturePath" value="images/history.gif">
  336.     <param name="AutoSize" value="-1">
  337.     <param name="BorderStyle" value="0">
  338.     <param name="SizeMode" value="3">
  339.     <param name="Size" value="2540;2540">
  340.     <param name="PictureAlignment" value="0">
  341.     <param name="VariousPropertyBits" value="19">
  342. </object>
  343.  
  344. <script language="VBScript">
  345.  
  346. Sub imgMusic_Click()
  347. popClasses.Clear
  348. <% i = 0 %>
  349.  
  350.  
  351. <!--METADATA TYPE="DesignerControl" startspan
  352.     <OBJECT ID="rsClasses" WIDTH=151 HEIGHT=24
  353.      CLASSID="CLSID:F602E721-A281-11CF-A5B7-0080C73AAC7E">
  354.         <PARAM NAME="_Version" VALUE="65536">
  355.         <PARAM NAME="_Version" VALUE="65536">
  356.         <PARAM NAME="_ExtentX" VALUE="3986">
  357.         <PARAM NAME="_ExtentY" VALUE="635">
  358.         <PARAM NAME="_StockProps" VALUE="0">
  359.         <PARAM NAME="DataConnection" VALUE="StateU">
  360.         <PARAM NAME="CommandText" VALUE="Select Title from Classes where MajorID=3">
  361.     </OBJECT>
  362. -->
  363. <%
  364. fHideNavBar = False
  365. fHideNumber = False
  366. fHideRequery = False
  367. fHideRule = False
  368. stQueryString = ""
  369. fEmptyRecordset = False
  370. fFirstPass = True
  371. fNeedRecordset = False
  372. fNoRecordset = False
  373. tBarAlignment = "Left"
  374. tHeaderName = "rsClasses"
  375. tPageSize = 0
  376. tPagingMove = ""
  377. tRangeType = "Text"
  378. tRecordsProcessed = 0
  379. tPrevAbsolutePage = 0
  380. intCurPos = 0
  381. intNewPos = 0
  382. fSupportsBookmarks = True
  383. fMoveAbsolute = False
  384.  
  385. If IsEmpty(Session("rsClasses_Recordset")) Then
  386.     fNeedRecordset = True
  387. Else
  388.     If Session("rsClasses_Recordset") Is Nothing Then
  389.         fNeedRecordset = True
  390.     Else
  391.         Set rsClasses = Session("rsClasses_Recordset")
  392.     End If
  393. End If
  394.  
  395. If fNeedRecordset Then
  396.     Set StateU = Server.CreateObject("ADODB.Connection")
  397.     StateU.ConnectionTimeout = Session("StateU_ConnectionTimeout")
  398.     StateU.CommandTimeout = Session("StateU_CommandTimeout")
  399.     StateU.Open Session("StateU_ConnectionString"), Session("StateU_RuntimeUserName"), Session("StateU_RuntimePassword")
  400.     Set cmdTemp = Server.CreateObject("ADODB.Command")
  401.     Set rsClasses = Server.CreateObject("ADODB.Recordset")
  402.     cmdTemp.CommandText = "Select Title from Classes where MajorID=3"
  403.     cmdTemp.CommandType = 1
  404.     Set cmdTemp.ActiveConnection = StateU
  405.     rsClasses.Open cmdTemp, , 0, 1
  406. End If
  407. On Error Resume Next
  408. If rsClasses.BOF And rsClasses.EOF Then fEmptyRecordset = True
  409. On Error Goto 0
  410. If Err Then fEmptyRecordset = True
  411.  
  412. If Not IsEmpty(Session("rsClasses_Filter")) And Not fEmptyRecordset Then
  413.     rsClasses.Filter = Session("rsClasses_Filter")
  414.     If rsClasses.BOF And rsClasses.EOF Then fEmptyRecordset = True
  415. End If
  416.  
  417. If fEmptyRecordset Then
  418.     fHideNavBar = True
  419.     fHideRule = True
  420. End If
  421.  
  422. Do
  423.     If fEmptyRecordset Then Exit Do
  424.     If Not fFirstPass Then
  425.         rsClasses.MoveNext
  426.     Else
  427.         fFirstPass = False
  428.     End If
  429.     If rsClasses.EOF Then Exit Do
  430. %>
  431. <!--METADATA TYPE="DesignerControl" endspan-->
  432. popClasses.AddItem "<%= rsClasses("title") %>",<%=i%>
  433. <%i = i+1%>  
  434.  
  435. <!--METADATA TYPE="DesignerControl" startspan
  436.     <OBJECT ID="DataRangeFtr3" WIDTH=151 HEIGHT=24
  437.      CLASSID="CLSID:F602E722-A281-11CF-A5B7-0080C73AAC7E">
  438.         <PARAM NAME="_Version" VALUE="65536">
  439.         <PARAM NAME="_ExtentX" VALUE="3986">
  440.         <PARAM NAME="_ExtentY" VALUE="635">
  441.         <PARAM NAME="_StockProps" VALUE="0">
  442.     </OBJECT>
  443. -->
  444. <%
  445. Loop
  446. If tRangeType = "Table" Then Response.Write "</TABLE>"
  447. If tPageSize > 0 Then
  448.     If Not fHideRule Then Response.Write "<HR>"
  449.     If Not fHideNavBar Then
  450.         %>
  451.         <TABLE WIDTH=100% >
  452.         <TR>
  453.             <TD WIDTH=100% >
  454.                 <P ALIGN=<%= tBarAlignment %> >
  455.                 <FORM <%= "ACTION=""" & Request.ServerVariables("PATH_INFO") & stQueryString & """" %> METHOD="POST">
  456.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   <<   ">
  457.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   <    ">
  458.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="    >   ">
  459.                     <% If fSupportsBookmarks Then %>
  460.                         <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   >>   ">
  461.                     <% End If %>
  462.                     <% If Not fHideRequery Then %>
  463.                         <INPUT TYPE="Submit" NAME="<% =tHeaderName & "_PagingMove" %>" VALUE=" Requery ">
  464.                     <% End If %>
  465.                 </FORM>
  466.                 </P>
  467.             </TD>
  468.             <TD VALIGN=MIDDLE ALIGN=RIGHT>
  469.                 <FONT SIZE=2>
  470.                 <%
  471.                 If Not fHideNumber Then
  472.                     If tPageSize > 1 Then
  473.                         Response.Write "<NOBR>Page: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
  474.                     Else
  475.                         Response.Write "<NOBR>Record: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
  476.                     End If
  477.                 End If
  478.                 %>
  479.                 </FONT>
  480.             </TD>
  481.         </TR>
  482.         </TABLE>
  483.     <%
  484.     End If
  485. End If
  486. %>
  487. <!--METADATA TYPE="DesignerControl" endspan-->
  488.  
  489. popClasses.PopUp
  490. end sub
  491.  
  492. </script> 
  493.  
  494. <object id="imgMusic"
  495.     name="imgMusic"
  496.     classid="CLSID:D4A97620-8E8F-11CF-93CD-00AA00C08FDF"
  497.     align="baseline" border="0" width="96" height="96">
  498.     <param name="PicturePath" value="images/Music.gif">
  499.     <param name="AutoSize" value="-1">
  500.     <param name="BorderStyle" value="0">
  501.     <param name="SizeMode" value="3">
  502.     <param name="Size" value="2540;2540">
  503.     <param name="PictureAlignment" value="0">
  504.     <param name="VariousPropertyBits" value="19">
  505. </object>
  506.  
  507. <object id="popClasses"
  508.     classid="CLSID:7823A620-9DD9-11CF-A662-00AA00C066D2"
  509.     codebase="controls/iemenu.ocx"
  510.     align="baseline" border="0" >
  511.     <param name="MenuItem[0]" value="Class 1">
  512.     <param name="MenuItem[1]" value="Class 2">
  513.     <param name="MenuItem[2]" value="Class 3">
  514.     <param name="MenuItem[3]" value="Class 4"> 
  515. </object>
  516.  
  517. </CENTER>
  518. </body>
  519. </html>
  520.